#include"process.h"
#define SIZE 101
#define STYLE '#'
void Flushprocess(const char* tips,double total,double current)
{
    char buffer[SIZE];
    memset(buffer,0,sizeof(buffer));
    double rate=current*100/total;
    int num=(int)rate;
    int num2=current*1000000/total;
    const char* lable="|/-\\";
    int i=0;
    int len=strlen(lable);
    for(i=0;i<=num;i++)
    {
        buffer[i]=STYLE;
    }
    printf("%s...[%-100s][%.5lf%%][%c]\r",tips,buffer,rate,lable[num2%len]);
    fflush(stdout);
}
